package com.commons.tools.multiconn.common2;

import java.util.HashMap;

/**
 * <p></p>
 *
 * @author
 * @date 2022/5/18
 */
public abstract class MultiConnDeviceBase {

    protected HashMap<Class<?>, Object> mapFunc = new HashMap<Class<?>, Object>();

    protected void addServiceObjectMap(Class<?> itfClass, Object implObj) {
        recursiveInterface(itfClass, implObj);
        mapFunc.put(itfClass, implObj);
    }

    private void recursiveInterface(Class<?> itfClass, Object implObj)
    {
        for (Class<?> clazz : itfClass.getInterfaces())
        {
            mapFunc.put(clazz, implObj);
            recursiveInterface(clazz, implObj);
        }
    }


}
